package com.cl.short_video_java.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

import lombok.Data;

/**
 * @TableName video_shop_order
 */
@TableName(value = "video_shop_order")
@Data
public class VideoShopOrder implements Serializable {
	/**
	 * 订单id
	 */
	@TableId
	private String orderId;

	/**
	 * 商品id
	 */
	private Integer shopId;

	/**
	 * 状态：0-未支付，1-已支付
	 */
	private Integer status;

	/**
	 * 创建时间
	 */
	private LocalDateTime createTime;

	/**
	 * 支付时间
	 */
	private LocalDateTime payTime;

	/**
	 * 是否删除：0-正常，1-删除
	 */
	private Integer isDelete;

	/**
	 * 商品总价
	 */
	private BigDecimal price;

	/**
	 * 实际支付价格
	 */
	private BigDecimal payPrice;

	/**
	 *
	 */
	private Integer userId;
	private String title;
	/**
	 * 优惠金额
	 */
	private BigDecimal preferential;

	/**
	 * 支付方式
	 */
	private Object payType;

	/**
	 * 订单完成时间
	 */
	private LocalDateTime finishTime;

	@TableField(exist = false)
	private static final long serialVersionUID = 1L;
	@TableField(exist = false)
	private Integer gold;

	@TableField(exist = false)
	private Integer shopType = 1;

	@TableField(exist = false)
	private VideoUser videoUser;
	@TableField(exist = false)
	private VideoShop videoShop;

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		VideoShopOrder other = (VideoShopOrder) that;
		return (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
				&& (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
				&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
				&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
				&& (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime()))
				&& (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
				&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
				&& (this.getPayPrice() == null ? other.getPayPrice() == null : this.getPayPrice().equals(other.getPayPrice()))
				&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
				&& (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals(other.getPayType()))
				&& (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
		result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
		result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
		result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
		result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode());
		result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
		result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
		result = prime * result + ((getPayPrice() == null) ? 0 : getPayPrice().hashCode());
		result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
		result = prime * result + ((getPayType() == null) ? 0 : getPayType().hashCode());
		result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().hashCode());
		return result;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(getClass().getSimpleName());
		sb.append(" [");
		sb.append("Hash = ").append(hashCode());
		sb.append(", orderId=").append(orderId);
		sb.append(", shopId=").append(shopId);
		sb.append(", status=").append(status);
		sb.append(", createTime=").append(createTime);
		sb.append(", payTime=").append(payTime);
		sb.append(", isDelete=").append(isDelete);
		sb.append(", price=").append(price);
		sb.append(", payPrice=").append(payPrice);
		sb.append(", userId=").append(userId);
		sb.append(", payType=").append(payType);
		sb.append(", finishTime=").append(finishTime);
		sb.append(", serialVersionUID=").append(serialVersionUID);
		sb.append("]");
		return sb.toString();
	}
}